using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;


using WindowsLive.Writer.Api;

namespace QuotesPlugin
{
    public class Plugin
    {
        public const String PublisherUrl = "http://www.codeplex.com/QuotesPlugin4WLW";        
        public const String PluginName = "QuotesPlugin";        
        public const String PluginDescription = "Insert quotes from quotes4all.net";
        public const String Version = "1.0";
    }

    [WriterPlugin("F28442AD-8AF6-46ac-834A-3A5A72E807CE", Plugin.PluginName, 
        ImagePath="icon.gif", 
        PublisherUrl=Plugin.PublisherUrl, 
        Description=Plugin.PluginDescription)]
    [InsertableContentSource("Quotes")]
    public class QP_ContentSource : ContentSource
    {
        public override DialogResult CreateContent(IWin32Window dialogOwner, ref string content)
        {
            DialogResult result = DialogResult.Cancel;
            if (content != null)
            {
                SelectQuotesForm form = new SelectQuotesForm();
                form.StartPosition = FormStartPosition.CenterParent;
                result = form.ShowDialog(dialogOwner);
                if (result == DialogResult.OK)
                {
                    content += form.Content;
                }                
            }
            
            return result;
        }
    }

}
